package com.lagou.demo.service.impl;

import com.lagou.demo.service.IDemoService;
import com.lagou.edu.mvcframework.annotations.LagouService;
import com.lagou.edu.mvcframework.pojo.ModelAndView;

import java.util.HashMap;
import java.util.Map;

@LagouService("demoService")
public class DemoServiceImpl implements IDemoService {
    @Override
    public ModelAndView get(String username) {
        System.out.println("service 实现类中的username参数：" + username) ;
        ModelAndView modelAndView = new ModelAndView();
        Map user = new HashMap();
        user.put("name",username);
        modelAndView.addModel("user",user);
        modelAndView.setView("jsp/index.jsp");
        return modelAndView;
    }
}
